import 'package:flutter/material.dart';
import 'package:ost_flutter_module/common/color.dart';
import 'package:ost_flutter_module/help/ost_route.dart';
import 'package:ost_flutter_module/widget/custom_widget/custome_underlineIndicator.dart';
import 'course_page/store_course_home_page.dart';
import 'course_page/widgets/store_app_bar.dart';
import 'point_page/store_point_home_page.dart';

class StoreHomePage extends StatefulWidget {
  @override
  _StoreHomePageState createState() => _StoreHomePageState();
}

class _StoreHomePageState extends State<StoreHomePage> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ost_flutter_module',
      debugShowCheckedModeBanner: false,
      routes: GRouter.routers(),
      home: DefaultTabController(
        length: 2,
        child: Scaffold(
          appBar: AppBar(
            backgroundColor: colorFAFAFA,
            elevation: 0,
            title: StoreAppBar(),
            bottom: PreferredSize(
              preferredSize: Size.fromHeight(48),
              child: Material(
                color: Colors.white,
                child: TabBar(
                  indicator: GUnderlineTabIndicator(
                    width: 30,
                    borderSide: BorderSide(width: 4.0, color: colorFACD33),
                  ),
                  labelColor: color42270C,
                  unselectedLabelColor: color999999,
                  labelStyle: TextStyle(fontSize: 16),
                  tabs: [Tab(text: '发现课程'), Tab(text: '积分商城')],
                ),
              ),
            ),
          ),
          body: TabBarView(
            children: [
              StoreCourseHomePage(),
              StorePointHomePage(),
            ],
          ),
        ),
      ),
    );
  }
}
